@extends('layouts.master')

@section('content')
     <section id="content" class="col-lg-10 col-lg-push-1">
       <div id="contentarea"> 
     <ul>
      @foreach($errors->all() as $error)
         <li>{{ $error }}</li>
      @endforeach
   </ul>
   

 <div class="text-center "> 
<strong><h1>User profile detail</h1></strong>
<hr>
 </div> 
 
    @if(Session::has('global'))
          <div class="alert alert-info">
        <p>{{Session::get('global')}}</p>
        </div>  
       @endif
     
   <form class="form-horizontal" role="form">
  <div class="form-group">
    <label class="col-sm-2 control-label"> {{ Form::label('Username', 'Username')}}</label>
     <div class="col-sm-10">
      <p class="form-control-static">{{$user->username}}</p>
    </div>
  </div>

 <div class="form-group">
    <label class="col-sm-2 control-label"> {{ Form::label('email', 'Email Address')}} </label>
     <div class="col-sm-10">
      <p class="form-control-static">{{$user->email}}</p>
    </div>
  </div>

 <div class="form-group">
    <label class="col-sm-2 control-label">  {{ Form::label('firstname', 'First Name')}}  </label>
     <div class="col-sm-10">
      <p class="form-control-static">{{$profile->first_name}}</p>
    </div>
  </div>

 <div class="form-group">
    <label class="col-sm-2 control-label"> {{ Form::label('lastname', 'last Name')}}  </label>
     <div class="col-sm-10">
      <p class="form-control-static">{{$profile->last_name}}</p>
    </div>
  </div>

<div class="form-group">
    <label class="col-sm-2 control-label"> {{ Form::label('address1', 'Address 1')}}  </label>
     <div class="col-sm-10">
      <p class="form-control-static">{{$profile->addres1}}</p>
    </div>
  </div>

  <div class="form-group">
    <label class="col-sm-2 control-label"> {{ Form::label('address1', 'Address 2')}}  </label>
     <div class="col-sm-10">
      <p class="form-control-static">{{$profile->addres2}}</p>
    </div>
  </div>

  <div class="form-group">
    <label class="col-sm-2 control-label">  {{ Form::label('city', 'city')}}   </label>
     <div class="col-sm-10">
      <p class="form-control-static">{{$profile->city}}</p>
    </div>
  </div>

  <div class="form-group">
    <label class="col-sm-2 control-label"> {{ Form::label('province', 'Province')}} </label>
     <div class="col-sm-10">
      <p class="form-control-static">{{$profile->province}}</p>
    </div>
  </div>

  <div class="form-group">
    <label class="col-sm-2 control-label">  {{ Form::label('country', 'Country')}} </label>
     <div class="col-sm-10">
      <p class="form-control-static">{{$profile->country}}</p>
    </div>
  </div>

 <div class="form-group">
    <label class="col-sm-2 control-label"> {{ Form::label('network', 'Network')}}  </label>
     <div class="col-sm-10">
      <p class="form-control-static"> {{$newtork}}</p>
    </div>
  </div>


@if($profile->company_id != 0 )

 <div class="form-group">
    <label class="col-sm-2 control-label">{{ Form::label('company', 'Company')}} </label>
     <div class="col-sm-10">
      <p class="form-control-static">  {{ link_to('/company/'.$profile->company_id, $companyname) }} </p>
    </div>
  </div>

@else
 <div class="form-group">
    <label class="col-sm-2 control-label"> {{ Form::label('company', 'Company')}}  </label>
     <div class="col-sm-10">
      <p class="form-control-static"> There is no company</p>
    </div>
  </div>

@endif

  @if($profile->user_id ==Auth::user()->id)

    <div class="form-group">
    <label class="col-sm-2 control-label"></label>
     <div class="col-sm-10">
      <p class="form-control-static">  <a href="/editprofile/{{$profile->id}}" class="btn submit btn btn-primary flex-table-btn js-submit" >edit profile</a></p>
    </div>
  </div>

    @endif
</form>
          
    </div>
    <br><br><br>
   
     <br><br><br><br><br><br><br><br><br><br>
    </section>
@stop